﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="LanguageConverterTemplate.TranslatePage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    IsTabStop="false"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:LanguageConverterTemplate"
    xmlns:common="using:LanguageConverterTemplate.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>

        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="AppName">My Application</x:String>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid>
        <Grid.Background>
            <ImageBrush ImageSource="Assets/Bg.jpg"/>
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Back button and page title -->
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
            <TextBlock x:Name="pageTitle" Grid.Column="1" Text="Scenario" Style="{StaticResource PageHeaderTextStyle}"/>
        </Grid>

        <ScrollViewer x:Name="ScrMain" Margin="0" Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" ZoomMode="Disabled">
            <StackPanel Height="628" Width="1176" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="120,0,0,0">
                <TextBlock HorizontalAlignment="Left" Margin="0" TextWrapping="Wrap" VerticalAlignment="Bottom" FontFamily="Segoe UI" FontSize="26.667" Text="Your Sub Heading Here"/>
                <StackPanel HorizontalAlignment="Left" Height="532" Margin="0,15,0,0" Width="1176" VerticalAlignment="Top" Orientation="Horizontal">
                    <Grid Height="532" Margin="0" VerticalAlignment="Top" Width="344" HorizontalAlignment="Left" Background="#D8161E09"/>
                    <Grid Height="532" Margin="15,0,0,0" VerticalAlignment="Top" Width="816" Background="#D8C3D1A1" HorizontalAlignment="Left">
                        <Grid HorizontalAlignment="Left" Height="496" Margin="40,40,0,0" VerticalAlignment="Top" Width="600">
                            <TextBlock HorizontalAlignment="Left" Margin="0" TextWrapping="Wrap" Text="TRANSLATE" VerticalAlignment="Top" Foreground="#FF1F1A02" FontFamily="Segoe UI" FontSize="32" FontWeight="SemiBold"/>
                            <StackPanel Margin="0,85,0,0" Orientation="Vertical" Width="250" HorizontalAlignment="Left" VerticalAlignment="Top">
                                <GridViewItem x:Name="GoodDay" Content="Language 1" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top" Foreground="#FF2E3192" FontSize="24" Height="50" Style="{StaticResource TextGridViewItemStyle}"/>
                                <GridViewItem x:Name="GoodMorning" Content="Language 2" HorizontalAlignment="Left" Margin="10,30,0,0" VerticalAlignment="Top" Foreground="#FF2E3192" FontSize="24" Height="50" Style="{StaticResource TextGridViewItemStyle}"/>
                                <GridViewItem x:Name="GoodAfternoon" Content="Language 3" HorizontalAlignment="Left" Margin="10,30,0,0" VerticalAlignment="Top" Foreground="#FF2E3192" FontSize="24" Height="50" Style="{StaticResource TextGridViewItemStyle}"/>
                                <GridViewItem x:Name="GoodEvening" Content="Language 4" HorizontalAlignment="Left" Margin="10,30,0,0" VerticalAlignment="Top" Foreground="#FF2E3192" FontSize="24" Height="50" Style="{StaticResource TextGridViewItemStyle}"/>
                                <GridViewItem x:Name="GoodEvening_Copy" Content="Language 5" HorizontalAlignment="Left" Margin="10,30,0,0" VerticalAlignment="Top" Foreground="#FF2E3192" FontSize="24" Height="50" Style="{StaticResource TextGridViewItemStyle}"/>
                            </StackPanel>
                            <StackPanel Margin="0,85,0,0" Orientation="Vertical" Width="300" Height="350" HorizontalAlignment="Right" VerticalAlignment="Top">
                                <TextBlock HorizontalAlignment="Left" Margin="0" TextWrapping="Wrap" Text="You entered:" Foreground="#FF9C2E0E" FontFamily="Segoe UI" FontSize="22.667"/>
                                <GridViewItem x:Name="HowRU" Content="Loper Islum" HorizontalAlignment="Left" Margin="0" VerticalAlignment="Top" Foreground="#FFBE1E2D" FontSize="29.333" Height="50" Style="{StaticResource TextGridViewItemStyle}" FontWeight="SemiBold" FontStyle="Italic"/>
                                <TextBlock HorizontalAlignment="Left" Margin="0,30,0,0" TextWrapping="Wrap" Text="Translated Text:" Foreground="#FF9C2E0E" FontFamily="Segoe UI" FontSize="22.667"/>
                                <GridViewItem x:Name="WhereRU" Content="Loper Islum" HorizontalAlignment="Left" Margin="0" VerticalAlignment="Top" Foreground="#FFBE1E2D" FontSize="29.333" Height="50" Style="{StaticResource TextGridViewItemStyle}" FontStyle="Italic"/>
                                <GridViewItem x:Name="Speak" Margin="0,30,0,0" Width="128" Height="41" HorizontalAlignment="Left" VerticalAlignment="Top">
                                    <Image Height="36" Source="images/Speak-01.png" Stretch="Fill" Width="124"/>
                                </GridViewItem>
                                <TextBlock HorizontalAlignment="Left" Margin="0" TextWrapping="Wrap" Text="Click to listen the translated text" FontFamily="Segoe UI" FontSize="17.333" Foreground="#FF9C2E0E" Width="300"/>
                            </StackPanel>
                        </Grid>
                    </Grid>
                </StackPanel>
            </StackPanel>
        </ScrollViewer>

        <Grid x:Name="SnapView" Grid.Row="1" Visibility="Collapsed">
            <TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="Please switch fullscreen to view content" VerticalAlignment="Center" 
                       FontFamily="Segoe UI" FontSize="26" TextAlignment="Center"/>
        </Grid>


        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's view state -->
            <VisualStateGroup>
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>

                <!-- The back button and title have different styles when snapped -->
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="SnapView">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ScrMain">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</common:LayoutAwarePage>
